<html>
    <head>
        <style>
            body {
                margin: 0;
                font-family: sans-serif;
                display: flex;
                gap: 10px;
                flex-direction: column;
            }

            .box {
                width: 100px;
                height: 100px;
                background-color: #0077ff;
                display: flex;
                align-items: center;
                justify-content: center;
                text-align: center;
            }
        </style>
    </head>
    <body>
        <div class="box" id="mini">mini</div>
        <div class="box" id="js">js</div>
        <div class="box" id="waapi">waapi</div>
        <script type="module" src="/src/inc.js"></script>
        <script type="module">
            const { animateMini, animate, delay } = window.Motion

            const options = {
                duration: 0.2,
            }

            const miniElement = document.querySelector("#mini")
            const jsElement = document.querySelector("#js")
            const waapiElement = document.querySelector("#waapi")

            const mini = animateMini(
                miniElement,
                { transform: "translateX(100px)" },
                options
            )
            const js = animate(jsElement, { x: 100 }, options)
            const waapi = animate(
                waapiElement,
                { transform: "translateX(100px)" },
                options
            )

            mini.finished.then(() => {
                miniElement.innerHTML = "finished"
            })
            js.finished.then(() => {
                jsElement.innerHTML = "finished"
            })
            waapi.finished.then(() => {
                waapiElement.innerHTML = "finished"
            })

            delay(() => {
                mini.cancel()
                js.cancel()
                waapi.cancel()
            }, 0.1)
        </script>
    </body>
</html>
